package cn.devpt.demo.entity;

import cn.devpt.dev.base.bean.AuditEntityBean;
import cn.devpt.dev.util.PtUtil;

import javax.persistence.*;
import java.util.Date;
import java.sql.Timestamp;

/**
 * @author admin
 * @date 2019-05-23
 */
@Entity
@Table(name = "pt_demo_table")
public class PtDemoTable extends AuditEntityBean {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @Id
    @Column(name = "TABLE_ID")
    private String tableId;

    /**
     * 下拉
     */
    @Column(name = "DROP_CODE")
    private String dropCode;

    /**
     * 下拉列表
     */
    @Column(name = "DROP_GRID_ID")
    private String dropGridId;

    /**
     *日期
     */
    @Column(name = "DATE_TIME")
    private Timestamp dateTime;

    /**
     *
     */
    @Column(name = "NAME")
    private String name;

    /**
     *排序号
     */
    @Column(name = "SORTER")
    private Double sorter;

    @Transient
    private String dropCodeStr;
    @Transient
    private String dropGridStr;

    public String getDropCodeStr() {
        return PtUtil.getDropName("DEMO_DROP", dropCode);
    }

    public void setDropCodeStr(String dropCodeStr) {
        this.dropCodeStr = dropCodeStr;
    }

    public String getDropGridStr() {
       return PtUtil.getUserName(dropGridId);
    }

    public void setDropGridStr(String dropGridStr) {
        this.dropGridStr = dropGridStr;
    }

    public String getTableId() {
        return this.tableId;
    }

    public void setTableId(String tableId) {
        this.tableId = tableId;
    }

    public String getDropCode() {
        return this.dropCode;
    }

    public void setDropCode(String dropCode) {
        this.dropCode = dropCode;
    }

    public String getDropGridId() {
        return this.dropGridId;
    }

    public void setDropGridId(String dropGridId) {
        this.dropGridId = dropGridId;
    }

    public Date getDateTime() {
        return this.dateTime;
    }

    public void setDateTime(Timestamp dateTime) {
        this.dateTime = dateTime;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getSorter() {
        return this.sorter;
    }

    public void setSorter(Double sorter) {
        this.sorter = sorter;
    }


}
